<script setup>
//clearContactDetails(点击事件): 关闭弹出层
//propsItem({title:""}): 头部标题内容
//rightInfo(true/false): 显示与隐藏头部右侧图标
//informationInfo(点击事件): 如果rightInfo为true显示右侧图标点击关闭右侧图标打开的第二个弹出层
//icon: 图标
const props = defineProps([
  "clearContactDetails",
  "propsItem",
  "rightInfo",
  "informationInfo",
  "icon",
]);
</script>

<template>
  <div class="titleNavbar">
    <van-nav-bar
      :title="props.propsItem.title"
      left-arrow
      @click-left="props.clearContactDetails"
    >
      <template #right v-if="props.rightInfo">
        <van-icon :name="props.icon" size="18" @click="props.informationInfo" />
      </template>
    </van-nav-bar>
  </div>
</template>

<style>
.van-nav-bar {
    background: #e5e5e5;
}

.van-nav-bar .van-icon {
  color: gray;
}
</style>
